<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			var hammingWeight = function(n) {
			    let ret = 0;
			    for (let i = 0; i < 32; i++) {
			        if ((n & (1 << i)) !== 0) {
			            ret++;
			        }
			    }
			    return ret;
			};
			console.log(hammingWeight("00000000000000000000000000001011"));
		</script>
	</body>
</html>
